# -*- coding:utf-8 -*-
from utils.db_utils import DbConn
import datetime
from utils.serialization import Serialization
from app.plane.common.plane_sql import PlaneManageSql

class PlaneEditDB(object):
    def __init__(self):
        self.serialization = Serialization()
    
    def edit_plane(self,body):
        params = ["object_id", "flag","status", "start_time", "end_time","id"]
        null_params = []
        sql = PlaneManageSql.PLANE_EDIT
        ret = self.serialization.commoit(body,params,null_params,sql)
        return ret
    
    def del_plane(self,body):
        params = ["id"]
        null_params = []
        sql = PlaneManageSql.PLANE_DEL
        ret = self.serialization.commoit(body,params,null_params,sql)
        return ret

        
    def add_plane(self,body):
        params = ["flag","status", "session_user_id", "start_time", "end_time"]
        null_params = ["start_time", "end_time"]
        sql = PlaneManageSql.PLANE_ADD
        ret = self.serialization.commoit(body,params,null_params,sql)
        return ret


        
        